package com.ftwj.demo.modular.vo.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.ftwj.demo.base.common.BaseDao;
import com.ftwj.demo.modular.vo.entity.ExcelMessageVo;

@Repository
public class ExcelMessageVoDao extends BaseDao<ExcelMessageVo, Integer> {

	public List<Map<String, Object>> queryMessAndReceive() {
		String sql = "SELECT m.title,m.content," + 
				"(SELECT u.show_name FROM tb_user u WHERE m.create_user = u.user_id) createUser," + 
				"(SELECT u.show_name FROM tb_user u WHERE mu.user_id = u.user_id) receiveUser,mu.update_time updateTime " + 
				"FROM tb_message m LEFT JOIN tb_message_user mu ON mu.mess_id = m.mess_id WHERE mu.state = 1 AND m.state = 1";
		return jtl.queryForList(sql);
	}

}
